#ifndef CMSERVER_COMMON_H

#define CMSERVER_COMMON_H

#include <signal.h>
#include <stdint.h>
#include <errno.h>
#include <pthread.h>
#include <stdarg.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/types.h>
#include <deque>
#include <stdio.h>
#include <sys/epoll.h>
#include <map>
#include <iostream>
#include <string.h>
#include <unistd.h>

#define LISTEN_PORT       8888
#define MAX_DATA_SIZE     1024*10
#define CONFIG_PATH       "./config.ini"
#define MAX_BUF           128
#define MAX_THREADS       5

#ifdef _DEBUG
#define DEBUG_LINE() printf("[%s:%s] line=%d\r\n",__FILE__, __func__, __LINE__)
#define DEBUG_ERR(fmt, args...) printf("\033[46;31m[%s:%d]\033[0m "#fmt" errno=%d, %m\r\n", __func__, __LINE__, ##args, errno, errno)
#define DEBUG_INFO(fmt, args...) printf("\033[33m[%s:%d]\033[0m "#fmt"\r\n", __func__, __LINE__, ##args)
#else
#define DEBUG_LINE()
#define DEBUG_ERR(fmt, ...)
#define DEBUG_INFO(fmt, ...)
#endif
typedef unsigned long ULONG;
typedef unsigned int  UINT;
struct FileInfo
{
	char fileVersion[MAX_BUF];    //Version
	char filePath[MAX_BUF];      // path 
	int  fileSize;
	char *pMapBuff;
};
struct CConfig {
	int    sockfd;
	int    listenPort;
	int    maxThreads;
	int    maxDataSize;
	int    bandWidth;
//	char   logPath[MAX_BUF];
//	char   ip[MAX_BUF];	
};
//epoll event
class CSockets;

#include <net_protocol.h>



#endif